// 组织架构的API模块
import request from '@/utils/request'

// 获取组织架构信息API
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 获取部门负责人
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

// 新增部门API
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 获取部门详情
export function getDepartDetail(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

// 修改部门信息
export function updateDepartments(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

// 删除部门信息
export function delDepartments(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

